package com.xxxx.common.result;

import com.github.pagehelper.PageInfo;
import com.xxxx.common.enums.BaseResultEnum;

import java.io.Serializable;

/**
 * 公共保存状态返回对象
 */
public class BaseResult implements Serializable {
    //状态编码
    private Integer code;
    //状态描述
    private String message;
    //分页对象(商品列表需要-pom.xml添加依赖)
    PageInfo<?> pageInfo;
    //成功返回的对象
    public static BaseResult success(){
        BaseResult result = new BaseResult();
        result.setCode(BaseResultEnum.SUCCESS.getCode());
        result.setMessage(BaseResultEnum.SUCCESS.getMessags());
        return result;
    }
    public BaseResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public BaseResult() {
    }

    public static BaseResult error() {
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }




    }




